import Vue from 'vue'
import VueRouter from 'vue-router'
import Loign from '../views/loign.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect:'/login'
  },
  {
    path: '/login',
    name: 'Loign',
    component: Loign
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import( '../views/index.vue'),
    meta:{
      isLogin:true,
    },
    children:[
      {
        path: '/index/',
        redirect:'/index/syn_index',
      },
        //宋亚宁
      {
        path:'/index/syn_index',
        name: 'syn_index',
        component: () => import( '../components/components1/syn_index.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        }
      },
      {
        path:'/index/syn_ckdd',
        name: 'syn_ckdd',
        component: () => import( '../components/components1/syn_ckdd.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
        //景兵
      {
        path:'/index/j_hyzf',
        name: 'j_hyzf',
        component: () => import( '../components/components1/j_hyzf.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
      {
        path:'/index/j_fhyzf',
        name: 'j_fhyzf',
        component: () => import( '../components/components1/j_fhyzf.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
      {
        path:'/index/j_czgl',
        name: 'j_czgl',
        component: () => import( '../components/components1/j_czgl.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
      {
        path:'/index/j_cxgz',
        name: 'j_cxgz',
        component: () => import( '../components/components1/j_cxgz.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
      {
        path:'/index/j_cq',
        name: 'j_cq',
        component: () => import( '../components/components1/j_cq.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
        //唐滔
      {
        path:'/index/tt_hycz',
        name: 'tt_hycz',
        component: () => import( '../components/components1/tt_hycz.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
      {
        path:'/index/tt_hycx',
        name: 'tt_hycx',
        component: () => import( '../components/components1/tt_hycx.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
      {
        path:'/index/tt_hyzc',
        name: 'tt_hyzc',
        component: () => import( '../components/components1/tt_hyzc.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
      {
        path:'/index/tt_grxx',
        name: 'tt_grxx',
        component: () => import( '../components/components1/tt_grxx.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','服务员']
        },
      },
        //明小龙
      {
        path:'/index/mxl_index',
        name: 'mxl_index',
        component: () => import( '../components/components2/mxl_index.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },

      {
        path:'/index/mxl_jbxx',
        name: 'mxl_jbxx',
        component: () => import( '../components/components2/mxl_jbxx.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {
        path:'/index/mxl_hsz',
        name: 'mxl_hsz',
        component: () => import( '../components/components2/mxl_hsz.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
        //彭明旺
      {//操作日志
        path:'/index/pmw_czrz',
        name: 'pmw_czrz',
        component: () => import( '../components/components2/pmw_czrz.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {//系统设置
        path:'/index/pmw_xtsj',
        name: 'pmw_xtsj',
        component: () => import( '../components/components2/pmw_xtsj.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {//供应商交易明细
        path:'/index/pmw_gysjymx',
        name: 'pmw_gysjymx',
        component: () => import( '../components/components2/pmw_gysjymx.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },{//工资管理
        path:'/index/pmw_gzgl',
        name: 'pmw_gzgl',
        component: () => import( '../components/components2/pmw_gzgl.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },{//
        path:'/index/pmw_lsdd',
        name: 'pmw_lsdd',
        component: () => import( '../components/components2/pmw_lsdd.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {//收支明细
        path:'/index/pmw_szmx',
        name: 'pmw_szmx',
        component: () => import( '../components/components2/pmw_szmx.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
        //梁玲玲
      {
        path:'/index/lll_pbkq',
        name: 'lll_pbkq',
        component: () => import( '../components/components2/lll_pbkq.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {
        path:'/index/lll_czgl',
        name: 'lll_czgl',
        component: () => import( '../components/components2/lll_czgl.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {
        path:'/index/lll_hugl',
        name: 'lll_hugl',
        component: () => import( '../components/components2/lll_hugl.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      // 陈斌
      {
        path:'/index/cb_cpgl',
        name: 'cb_cpsz',
        component: () => import( '../components/components2/cb_cpgl.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {
        path:'/index/cb_xhpgl',
        name: 'cb_xhpgl',
        component: () => import( '../components/components2/cb_xhpgl.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },
      {
        path:'/index/cb_jhhch',
        name: 'cb_jhhch',
        component: () => import( '../components/components2/cb_jhhch.vue'),
        meta:{
          isLogin:true,
          roles:['超级管理员','管理员']
        },
      },

      // {
      //   path:'/index',  //区别于上面的 path: '/Index'
      //   redirect:'/index/tablea'  //重新定向index组件中的about组件
      // }




         //测试
      {
        path:'/index/CanZhuoGuanLi',
        name: 'CanZhuoGuanLi',
        component: () => import( '../components/components1/j_czgl'),
        meta:{
          isLogin:true,
          roles:['超级管理员']
        },
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
